<?php

$params = array_merge(
        require(__DIR__ . '/../../common/config/params.php'),
		require(__DIR__ . '/params.php')
);

return [
    'id'                  => 'merchant',
    'name'                => '添添有彩-商家中心',
    'basePath'            => dirname(__DIR__),
    'controllerNamespace' => 'merchant\controllers',
    'bootstrap'           => ['log'],
    'modules'             => [],
    'components'          => [
        'view'         => [
            'theme' => [
                'pathMap' => [
                    '@dektrium/user/views' => '@app/views/user',
                ],
            ],
        ],
        'request'      => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'a3425nbdsarathw45',
            'enableCsrfCookie'    => false
        ],
        'log'          => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets'    => [
                [
                    'class'  => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'as access'    => [
            'class'        => 'mdm\admin\components\AccessControl',
            'allowActions' => [
                'user/*',
                'site/*',
                'admin/*',
                'some-controller/some-action',
            ]
        ],
        'errorHandler' => [
            'errorAction' => '/site/error',
        ],
        'store' => [
            'class' => '\merchant\components\Store'
        ]
    ],
    'as globalAccess' => [
        'class' => '\common\behaviors\GlobalAccessBehavior',
        'rules' => [
            [
                'controllers' => ['user'],
                'actions'     => ['login']
            ],
        ],
    ],
    'modules'         => require(__DIR__ . '/modules.php'),
    'params'          => $params,
];
